<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");
include_once("$g4[path]/lib/category.lib.php");

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>

$table_width = 1004;

if ($member['mb_id']) {
	$sql = " select count(*) as cnt from {$g4['write_prefix']}$bo_table where mb_id = '$member[mb_id]' and wr_is_comment=0 ";
	$row = sql_fetch($sql);
	$my_write_count = $row['cnt'];
}
?>
					<?
                    $SQL =  "SELECT count(1) cnt     ";
					$SQL .= "  FROM g4_lounge        ";
					$SQL .= " WHERE mb_id = '".$member['mb_id']."' ";
                    
					$row = sql_fetch($SQL);
					$bookmark_cnt = $row['cnt'];
					
					$SQL =  "SELECT lounge            ";
					$SQL .= "  FROM g4_lounge         ";
					$SQL .= " WHERE mb_id = '".$member['mb_id']."' ";
					$SQL .= "ORDER BY lounge          ";
					
					$result = sql_query($SQL);

                    ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$g4['charset']?>" />
<title>구매글</title>
<link rel="stylesheet" type="text/css" href="/css/home.css">
<link rel="stylesheet" type="text/css" href="/css/reset.css">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">

#apDiv1 {
	position:absolute;
	width:270px;
	z-index:1;
}

.tas{position:absolute;z-index:1;}
.tas ul, .tas li, .tas ol{list-style:none;margin:0; padding:0;}
.tas ul{margin:13px 0 0 15px; float:left; width:135px;}
.tas ul .title{font-weight:bold; margin-bottom:5px; color:#3f3f3f;}
.tas ul li{font-size:12px; color:#969696; line-height:18px;}

.tas2{position:absolute;z-index:1; margin-left:120px;}

	.follow{overflow:hidden; padding:20px 0; border-bottom:1px solid #dedede; color:#615a59; font-size:13px; line-height:18px;}
	.follow dt{float:left; margin-right:16px;}
	.follow dd strong{font-family:Arial; font-size:18px; margin-right:10px;}
	.follow .pl_name{overflow:hidden; width:536px; margin-bottom:7px;}
	.pl_name .pn01{float:left;}
	.pl_name .pn02{float:right; font-weight:bold; padding-right:5px;}
	.follow .pl_info{font-weight:bold; font-size:12px; margin-bottom:10px;}
	.follow .pl_cnt{font-style:italic; margin-bottom:18px;}
	.follow .pl_cnt span{color:#cb4b6e; font-weight:bold; display:block; font-size:11px; font-style:normal;}
	
	.follow_u{margin:0; padding:0; font-size:12px; line-height:22px; font-weight:bold; color:#777; margin-bottom:20px; padding-top:20px;}
	.follow_u li{list-style:none;}
	
	.page_list{height:20px; margin-bottom:40px; margin-left:80px;}
	.page_list img{vertical-align:middle;}
	.list_num a{font-size:11px; text-decoration:none; display:inline-block; height:18px; width:18px; text-align:center; line-height:18px; border:2px solid #ccc; color:#6e6b73; font-weight:bold;}
	.list_num a:hover{border:2px solid #6e8ed5; color:#6e8ed5;}
</style>
<script type="text/javascript">
function showProfile(mb_id){
	$.ajax({
		  type: "POST",
		  url: "/skin/board/basic2/show_profile_ajax.php",
		  data: {
			  "mb_id": mb_id,
			  "bo_table": "g4_write_buyitem"
		  },
		  success: function(html){
			  $("#profile").html(html);
			  $("#profile").show();
		  }
	});
	return;
}

function showLayerLounge(){
	if($("#flagLayer").val() == "Y"){
		$("#apDiv1").hide("fast");
		$("#flagLayer").val("N");
	}else{
		$("#apDiv1").show("fast");
		$("#flagLayer").val("Y");
	}
}

function showLayerBookMark(){
	if($("#loungeMarkLayer").val() == "Y"){
		$("#loungeMark").hide();
		$("#loungeMarkLayer").val("N");
	}else{
		$("#loungeMark").show();
		$("#loungeMarkLayer").val("Y");
	}
}

function addBookMark(loungeName){
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/add_bookmark_ajax.php",
		  data: {
			  "mb_id": "<?=$member[mb_id]?>",
			  "lounge": loungeName
		  },
		  success: function(html){
			  if(html == "0"){
				alert(loungeName+"을(를) 즐겨찾기 라운지에 추가하였습니다");
			  }else{
				  alert(loungeName+"을(를) 즐겨찾기 라운지에 삭제하였습니다");
			  }
			  showLayerBookMark();
			  location.reload();
		  }
	});
}

function goLounge(){
	if ($("#bookMarkLounge").val()!=""){
		goMySearch('my_lounge',$("#bookMarkLounge").val());
	}
	
}

$(function(){
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/apDiv1_ajax.php",
		  data: "searchText=",
		  success: function(html){
		    $("#apDiv1").html(html);
		  }
		});
});

function imgChange(imgNo, imgPath){
	$(".bigImg").eq(imgNo).attr("src",imgPath);
}

$(document).ready(function(){
		<?if ($bo_gubun=="member_write"){
		echo "showProfile('$param_data');";
		}else if($member['mb_id']){
		echo "$('#profile').show();";
		}?>
		
	$(".bigImg").bind('click',function(){
		if ($(this).attr("src") != "/img/noImage183x136.gif"){
			$("#layerImg0").attr("src",$(this).attr("src"));
			var newImg = new Image();
			newImg.src = $(this).attr("src");
			if ((newImg.width*411/newImg.height) > 711){
				$("#layerImg0").attr("width",'711');
			}else{
				$("#layerImg0").attr("width",newImg.width*411/newImg.height);
			}
			$("#layerImg1").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('0').attr("src"));
			$("#layerImg2").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('1').attr("src"));
			$("#layerImg3").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('2').attr("src"));
			$("#layerImg4").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('3').attr("src"));
			yPosition = $(document).scrollTop()-420;   
		    $("#bigImage").animate({"top":yPosition }, {duration:'fast', easing:'swing', queue:false});
			$("#bigImage").show();
			$("body").css("oracity","0.2");
			$("body").css("filter","alpha(opacity=20)");
			document.body.scroll = "no";
		    document.body.style.overflow = 'hidden';
		}
	});

	$(".classImg").bind('click',function(){
		$("#layerImg0").attr("src",$(this).attr("src"));
		var newImg = new Image();
		newImg.src = $(this).attr("src");
		if ((newImg.width*411/newImg.height) > 711){
			$("#layerImg0").attr("width",'711');
		}else{
			$("#layerImg0").attr("width",newImg.width*411/newImg.height);
		}
	});

	$(".imgClass").click(function(event){ 
		event.stopPropagation();
	});
	
	$(document.body).click(function(){
		hideBigImage();
	});

	//스크롤이벤트가 발생하면   
	$(window).scroll(function(){   
		yPosition = $(document).scrollTop()-420;   
	    //yPosition = $(document).scrollTop()-500;
	    $("#bigImage").animate({"top":yPosition }, {duration:'fast', easing:'swing', queue:false});   
	});
});

function hideBigImage(){
	$("#bigImage").hide();
	$("body").css("oracity","");
	$("body").css("filter","");
	document.body.scroll = "yes";
	document.body.style.overflow = 'scroll';
}

function nextImg(){
	flagCon = true;
	$("#pLayer").find("img").each(function(index){
		if ($(this).attr("src")==$("#layerImg0").attr("src") && index < 3 && flagCon){
			$("#layerImg0").attr("src",$("#layerImg"+(index+2)).attr("src"));
			flagCon=false;
		}
	});
}

function nextImg(goPos){
	flagCon = true;
	$("#pLayer").find("img").each(function(index){
		if (goPos==1){
			if ($(this).attr("src")==$("#layerImg0").attr("src") && index < 3 && flagCon){
				$("#layerImg0").attr("src",$("#layerImg"+(index+2)).attr("src"));
				var newImg = new Image();
				newImg.src = $("#layerImg"+(index+2)).attr("src");
				if ((newImg.width*411/newImg.height) > 711){
					$("#layerImg0").attr("width",'711');
				}else{
					$("#layerImg0").attr("width",newImg.width*411/newImg.height);
				}
				flagCon=false;
			}
		}else{
			if ($(this).attr("src")==$("#layerImg0").attr("src") && index > 0 && flagCon){
				$("#layerImg0").attr("src",$("#layerImg"+(index)).attr("src"));
				var newImg = new Image();
				newImg.src = $("#layerImg"+(index)).attr("src");
				if ((newImg.width*411/newImg.height) > 711){
					$("#layerImg0").attr("width",'711');
				}else{
					$("#layerImg0").attr("width",newImg.width*411/newImg.height);
				}
				flagCon=false;
			}
		}
	});
}

function loungeSearch(){
	if ($("#loungeStx").val().length < 1) {
        alert("검색어를 입력하십시오.");
        $("#loungeStx").select();
        $("#loungeStx").focus();
        return;
    }
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/apDiv1_ajax.php",
		  data: "searchText="+encodeURIComponent($("#loungeStx").val()),
		  success: function(html){
		    $("#apDiv1").html(html);
		  }
		});
}
</script>
</head>
<body>

<!-- 상단 배경 시작 -->
<table width="1007" cellspacing="0" cellpadding="0" align="center">
	<tr>
    	<td width="706" valign="top" class="right_line">
    	<form name="fsearchbox" method="get" onsubmit="return fsearchbox_submit(this);" style="margin:0px;padding-left:0;">
    		<table width="706" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td height="50">&nbsp;</td>
				</tr>
				<tr>
					<td height="80" align="center" valign="top"><a href="/bbs/board_buyitem.php?bo_table=buyitem"><img src="../img/comm/logo.gif" width="302" height="71" border="0" /></a></td>
				</tr>
				<tr>
					<td height="85" valign="top">
						<table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
							<tr>
								<td align="left" width="375">
									<?=getCategoty($bo_table);?>
								<?if($bo_gubun=='my_lounge'){?>
	            <span style="display:inline-block; padding-right:5px; font-size:14px;font-family:Dotum; vertical-align:top; height:17px;padding-top:5px;margin-left:50px;">#<?=$param_data?></span>
	            <a href="javascript:showLayerBookMark();">
	            <?
	            	$loungeflag = 0;
		      		for ($i=0; $row=sql_fetch_array($result); $i++){
						if ($row['lounge'] == $param_data){
							$loungeflag = 1;
						}
					}
					if (!$loungeflag){
						echo "<img src=\"../img/product/bt_favorites.gif\" border=\"0\" />";
					}else{
						echo "<img src=\"../img/product/bt_favoritesr.gif\" border=\"0\" />";
					}
                ?>
	            </a>
	            <input type="hidden" id="loungeMarkLayer" value="N"/>
	            <div class="tas2">
					<div id="loungeMark" style="margin-top:-2px;width:274px; border:1px solid #ccc; background:#fff; text-align:center;padding:15px; display: none;">
						<div>"<?=$param_data?>" 라운지를</div>
						<div>
						<?
	            		if (!$loungeflag){
							echo "즐겨찾기 하시겠습니까?";
						}else{
							echo "즐겨찾기 삭제하시겠습니까?";
						}
						?>
						</div>
						<p>
							<a href="javascript:addBookMark('<?=$param_data?>');"><img src="../img/product/bt_enter1.gif" border="0" /></a>
							<a href="javascript:showLayerBookMark();"><img src="../img/product/bt_cancle.gif" border="0" /></a>
						</p>
					</div>
				</div>
	            <?}?>
								</td>
								<td align="right">
									<a href="<?=$g4['path']?>/bbs/write_sellitem.php?bo_table=<?=$bo_table?>&chkItem=buy&param_data=<?=$param_data?>""><img src="../img/comm/bt_write01.gif" width="102" height="32" border="0" /></a>
								</td>
							</tr>
							<tr>
								<td colspan="2">
		            				<input type="hidden" name="sfl" value="wr_content||wr_name||wr_10||itemBrand||itemName"/>
	        						<input type="hidden" name="sop" value="and"/>
	        						<input type="hidden" name="bo_table" value="<?=$bo_table?>"/>
		            				<input name="stx" type="text" class="box5a" id="stx" value="<?=$stx?>" /><input type="image" src="../img/product/bt_search02.gif" align="absmiddle" />
		           				</td>
							</tr>
						</table>
					</td>
				</tr>
				<!-- tr>
					<td height="1" bgcolor="D1D1D1"></td>
				</tr-->
			</table>
		</form>
		</td>
		<td width="306" valign="top">
			<table width="270" border="0" align="right" cellpadding="0" cellspacing="0">
				<tr>
					<td height="17">&nbsp;</td>
				</tr>
				<tr>
					<td align="right">
						<a href="/"><img src="../img/comm/smenu_home.gif" alt="" width="10" height="11" border="0" /></a>
						<img src="../img/comm/smenu_line.gif" width="2" height="12" hspace="7" />
						<a href="<?=$g4['path']?>/bbs/board_sellitem.php?bo_table=sellitem"><img src="../img/comm/smenu_buy.gif" width="38" height="11" border="0" /></a>
						<img src="../img/comm/smenu_line.gif" alt="" width="2" height="12" hspace="7" />
						<a href="<?=$g4['path']?>/bbs/board_sellhome.php?bo_table=sellhome"><img src="../img/comm/smenu_home01.gif" width="37" height="11" border="0" /></a>
						<img src="../img/comm/smenu_line.gif" alt="" width="2" height="12" hspace="7" />
						<a href="#"><img src="../img/comm/smenu_job.gif" width="47" height="11" border="0" /></a>
					</td>
				</tr>
				<tr>
					<td height="38">&nbsp;</td>
				</tr>
				<tr>
					<td><?=outlogin("basic2"); // 외부 로그인 ?></td>
				</tr>
				<?if ($member['mb_id']){?>
		      <tr>
            <td height="40" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td colspan="2">
                    <select id="bookMarkLounge" onchange="javascript:goLounge();" style="width: 100%">
                    	<option value="">::: 즐겨찾기한 라운지(<?=$bookmark_cnt?>) 바로가기:::</option>
                    <?
                    $result = sql_query($SQL);
		      		for ($i=0; $row=sql_fetch_array($result); $i++){
						echo "<option value=\"".$row['lounge']."\">".$row['lounge']."</option>";
					}
                    ?>
                    </select>
                </td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td colspan="2">
            	<a href="javascript:showLayerLounge();"><img src="../img/product/bt_search01.gif" width="270" height="30" border="0" /></a>
            	<input type="hidden" name="flagLayer" id="flagLayer" value="N">
            </td>
          </tr>
          <?}?>
          <tr>
          	<td valign="top">
          		<div id="apDiv1" style="display:none;">
        		</div>
          	</td>
          </tr>
			</table>
		</td>
	</tr>
</table>
<!-- 상단 배경 끝 -->

<script type="text/javascript">
function fsearchbox_submit(f)
{
    if (f.stx.value.length < 2) {
        alert("검색어는 두글자 이상 입력하십시오.");
        f.stx.select();
        f.stx.focus();
        return false;
    }

    // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
    var cnt = 0;
    for (var i=0; i<f.stx.value.length; i++) {
        if (f.stx.value.charAt(i) == ' ')
            cnt++;
    }

    if (cnt > 1) {
        alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
        f.stx.select();
        f.stx.focus();
        return false;
    }

    f.action = "<?=$g4['bbs_path']?>/board_buyitem.php";
    return true;
}
</script>
<!-- 검색 끝 -->
<script type="text/javascript" src="../js/sideview.js"></script>

<table width="1007" cellpadding=0 cellspacing=0 align="center">
	<tr>
		<td width="706" valign="top" class="right_line">
			<table width="100%" cellpadding=0 cellspacing=0><tr><td valign=top>
				<tr>
					<td height="104" align="center">
						<a href="<?=$g4['path']?>/bbs/board_sellitem.php?bo_table=sellitem&bo_gubun=<?=$bo_gubun?>&param_data=<?=$param_data?>&param_data2=<?=$param_data2?>"><img src="../img/product/tab01.gif" border="0" /></a><img src="../img/product/tab02_on.gif"  border="0" />
					</td>
				</tr>
				<tr>
					<td>
						<div style="padding:20px 0;text-align:center;border: 1">
							<!-- 배너 들어가는곳 -->
							<img src="/img/banner/banner.jpg" width="90%" height="100%"/>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div style="width:675px;display: none;" id="profile">
							<?if ($member['mb_id']){?>
							<!-- dl class="follow">
								<dt><img src="<?if($member['mb_icon'])echo $member['mb_icon'];else echo "/img/noImage183x136.gif";?>" width="123" height="123" /></dt>
								<dd class="pl_name"><span class="pn01"><strong><?=$member['mb_nick']?></strong> <?=$member['mb_addr1_1']?></span><span class="pn02"><a href="javascript:win_memo('/bbs/memo_form.php?me_recv_mb_id=<?=$member['mb_nick']?>')">쪽지보내기</a></span></dd>
								<dd class="pl_cnt">
									<?=$member['mb_intro']?>
								</dd>
								<dd class="pl_info"><a href="javascript:goMySearch('my_write');" style="display:inline-block;">게시글(<?=$my_write_count?>)</a></dd>
							</dl-->
							<?}?>
						</div>
					</td>
				</tr>

			</table>
			<!-- 게시판 목록 시작 -->
			<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
						<div class="board_top">
							<div style="float:left;">
<form name="fcategory" method="get" style="margin:0px;">
						<? if (!$is_category) { ?>
								<select name=sca onchange="location='<?=$category_location?>'+<?=strtolower($g4[charset])=='utf-8' ? "encodeURIComponent(this.value)" : "this.value"?>;">
									<option value=''>전체</option>
									<?=$category_option?>
								</select>
						<? } ?>
</form>
							</div>
		<div id="bigImage" class="imgClass" style="position:relative;display: none;">
			<div style="position:absolute; top:30px; left:30px; width:830px; height:600px; background:#000; z-index:999;">
				<div style="position:absolute; left:60px; top:20px;">
					<p style="margin-bottom:17px;" align="center"><img id="layerImg0" src="../img/home/sample_img01.gif" width='711' height="411" /></p>
					<p id="pLayer" style="width:711px; text-align:center;">
						<a href="javascript:" style="margin-right:16px"><img id="layerImg1" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:" style="margin-right:16px"><img id="layerImg2" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:" style="margin-right:16px"><img id="layerImg3" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
						<a href="javascript:"><img id="layerImg4" src="../img/home/sample_img02.gif" width='162' height="126" class="classImg" /></a>
					</p>
				</div>
				<div style="position:absolute; left:30px; top:222px;"><a href="javascript:nextImg(-1);"><img src="../img/home/btn_pre.gif" /></a></div>
				<div style="position:absolute; left:789px; top:222px;"><a href="javascript:nextImg(1);"><img src="../img/home/bt_next.gif" /></a></div>
				<div style="position:absolute; top:7px; right:7px;"><a href="javascript:hideBigImage();"><img src="../img/home/btn_close.gif" /></a></div>
			</div>
			
		</div>
							<div style="float:right;">
							<!-- 
								<img src="<?=$board_skin_path?>/img/icon_total.gif" align="absmiddle" border='0'>
								<span style="color:#888888; font-weight:bold;">Total <?=number_format($total_count)?></span>
							-->
						<? if ($rss_href) { ?><a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' border='0' align="absmiddle"></a><?}?>
						<? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" border='0' title="관리자" align="absmiddle"></a><?}?>
							</div>
						</div>
<!-- 제목 -->
<form name="fboardlist" method="post">
						<input type='hidden' name='bo_table' value='<?=$bo_table?>'>
						<input type='hidden' name='sfl'  value='<?=$sfl?>'>
						<input type='hidden' name='stx'  value='<?=$stx?>'>
						<input type='hidden' name='spt'  value='<?=$spt?>'>
						<input type='hidden' name='page' value='<?=$page?>'>
						<input type='hidden' name='sw'   value=''>

<div id="dis_table">
						<table cellspacing="0" cellpadding="0" class="board_list">
<?if (1==2){?>
							<col width="50" />
<? if ($is_checkbox) { ?>	<col width="40" /><? } ?>
							<col />
							<col width="60" />
							<col width="40" />
							<col width="50" />
<? if ($is_good) { ?>		<col width="40" /><? } ?>
<? if ($is_nogood) { ?>		<col width="40" /><? } ?>
							<tr>
								<th>번호</th>
<? if ($is_checkbox) { ?>
								<th><input onclick="if (this.checked) all_checked(true); else all_checked(false);" type="checkbox"></th><?}?>
								<th>상&nbsp;&nbsp;&nbsp;품</th>
								<th>글쓴이</th>
								<th><?=subject_sort_link('wr_datetime', $qstr2, 1)?>날짜</a></th>
								<th><?=subject_sort_link('wr_hit', $qstr2, 1)?>조회</a></th>
<? if ($is_good) { ?>			<th><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></th><?}?>
<? if ($is_nogood) { ?>			<th><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></th><?}?>
							</tr>
<?}?>
<? 
    for ($i=0; $i<count($list); $i++) { 
        $bg = $i%2 ? 0 : 1;
?>
	<? if ($i==0 || substr($list[$i][wr_datetime],0,10) != substr($list[$i-1][wr_datetime],0,10) ){?>
    <!-- tr class="list_<?=$list[$i][wr_id]?>">
		<td>
			<div >
				<div style="width:101px; margin:0 auto;">
					<div style="height:55px; border-bottom:1px solid #dbdbdb; text-align:center;margin:0;margin-bottom:4px;"><img src="/img/comm/num_0<?=substr($list[$i][wr_datetime],8,1)?>.jpg" alt="" /> <img src="/img/comm/num_0<?=substr($list[$i][wr_datetime],9,1)?>.jpg" alt="" /> </div>
					<div style="overflow:hidden;">
						<div style="float:left;"><img src="/img/comm/mon_<?=substr($list[$i][wr_datetime],5,2)?>.jpg" alt="" /></div>
						<div style="float:right;"><img src="/img/comm/year_<?=substr($list[$i][wr_datetime],0,4)?>.jpg" alt="" /></div>
					</div>
				</div>
			</div>
		</td>
	</tr-->
	<?}?>
							<tr class="list_<?=$list[$i][wr_id]?>">
								<td height="1" bgcolor="DCDCDC"></td>
							</tr>
							<tr class="list_<?=$list[$i][wr_id]?>">
								<td height="40">
									<table width="675" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="450" class="txt14"><?=$list[$i][ca_name_1]?> &gt; <span class="txt18_point"><?=$list[$i][ca_name_2]?></span></td>
											<td width="169" align="center" class="txt14">By <?=$list[$i][name_sub]?><img src="<?=$list[$i][mb_icon]?>" width="22" height="23" align="absmiddle" />&nbsp;</td>
											<td width="56">
												<div style="width:56px; height:19px; background:url('../img/product/days02_bg.gif') no-repeat; color:#fff; font-size:12px;text-align:center;padding-top:3px;">
												<?=$list[$i][diff]?></div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr class="list_<?=$list[$i][wr_id]?>">
								<td valign="top">
									<table width="675" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="215" rowspan="3" valign="top">
												<table width="183" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td colspan="4">
															<table border="1" cellpadding="0" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
																<tr>
																	<td>
                        	<?if (!$list[$i][file][0]){?>
																		<img src="/img/noImage183x136.gif" width="183" height="136" class='bigImg'/>
                        	<?} else {?>
																		<a href="javascript:"><img src="<?echo $list[$i][file][0][path]."/".$list[$i][file][0][file]?>" width="183" height="136" class='bigImg imgClass'/></a>
                        	<?}?>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td>
															<table border="1" cellpadding="0" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
																<tr>
																	<td>
                        	<?if ($list[$i][file][0]){
									echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][0][path]."/".$list[$i][file][0][file]."');\"><img src='".$list[$i][file][0][path]."/".$list[$i][file][0][file]."' align='absmiddle' border='0' width='42' height='34'></a>";
                            } else {
									echo "<img src=\"/img/noImage183x136.gif\" width=\"42\" height=\"34\" />";
                        	}?>
																	</td>
																</tr>
															</table>
														</td>
														<td>
															<table border="1" cellpadding="0" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
																<tr>
																	<td>
                        	<?if ($list[$i][file][1]){
									echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][1][path]."/".$list[$i][file][1][file]."');\"><img src='".$list[$i][file][1][path]."/".$list[$i][file][1][file]."' align='absmiddle' border='0' width='42' height='34'></a>";
                            } else {
									echo "<img src=\"/img/noImage183x136.gif\" width=\"42\" height=\"34\" />";
                            }?>
																	</td>
																</tr>
															</table>
														</td>
														<td height="44">
															<table border="1" cellpadding="0" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
																<tr>
																	<td>
                        	<?if ($list[$i][file][2]){
									echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][2][path]."/".$list[$i][file][2][file]."');\"><img src='".$list[$i][file][2][path]."/".$list[$i][file][2][file]."' align='absmiddle' border='0' width='42' height='34'></a>";
                            } else {
									echo "<img src=\"/img/noImage183x136.gif\" width=\"42\" height=\"34\" />";
                            }?>
																	</td>
																</tr>
 															</table>
 														</td>
														<td>
															<table border="1" cellpadding="0" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
																<tr>
																	<td>
                            <?if ($list[$i][file][3]){
									echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][3][path]."/".$list[$i][file][3][file]."');\"><img src='".$list[$i][file][3][path]."/".$list[$i][file][3][file]."' align='absmiddle' border='0' width='42' height='34'></a>";
                            } else {
									echo "<img src=\"/img/noImage183x136.gif\" width=\"42\" height=\"34\" />";
                            }?>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
											<td width="460">
												<table width="460" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="33%" height="67"><span class="txt14"><?=$list[$i][itemBrand]?></span></td>
														<td width="33%" align="center"><span class="txt14"><?=$list[$i][itemName]?></span></td>
														<td width="33%" align="right"><span class="txt14"><?=han_price($list[$i][itemPrice])?></span></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td>
												<table width="460" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="393" height="23" class="txt14_g"><?=$list[$i][wr_area]?></td>
														<td width="87" class="txt14_g"><input type="checkbox" name="checkbox" id="checkbox" disabled="disabled" <?if ($list[$i][wr_1]){?>checked="checked"<?}?> />직거래</td>
													</tr>
													<tr>
														<td height="23" class="txt14_g"><?if($list[$i][wr_10]){echo "#".$list[$i][wr_10];}?></td>
														<td class="txt14_g"><input type="checkbox" name="checkbox2" id="checkbox2" disabled="disabled" <?if ($list[$i][wr_2]){?>checked="checked"<?}?> />택배</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td valign="bottom" align="right">&nbsp;
	<?
		if ($member['mb_id']){
			if ($member['mb_id']==$list[$i]['mb_id']) {
	?>
    											<img src="../img/product/bt_modify.gif" align="absmiddle" style="cursor:pointer;" onclick="javascript:goModify(<?=$list[$i][wr_id]?>);" />
    											<img src="../img/product/bt_del.gif" align="absmiddle" style="cursor:pointer;" onclick="javascript:goDelete(<?=$list[$i][wr_id]?>);" />
    <? 
    		}else{ 
					if($list[$i]['scrap_cnt'] == "0"){
   	?>	
   											<div id="scripView_<?=$list[$i][wr_id]?>">
												<img src="../img/product/bt_plus.gif" width="93" height="22" style="cursor:pointer;" onclick="javascript:goScrap(<?=$list[$i][wr_id]?>);" />
											</div>
	<?
					}else{
	?>
											<div id="scripView_<?=$list[$i][wr_id]?>">
												<img src="../img/product/bt_minus.gif" width="93" height="22" style="cursor:pointer;" onclick="javascript:goScrapDel(<?=$list[$i][wr_id]?>);" />
											</div>
	<?
				}
    		}
    	}
    ?>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr class="divDetail list_<?=$list[$i][wr_id]?>" style="display:none">
								<td>
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td colspan="2">
												<table width="100%" border="0" cellpadding="5" cellspacing="1" bordercolor="D9D9D9" bgcolor="D9D9D9">
													<tr>
														<td bgcolor="#FFFFFF"><?=str_replace("\n","<br>", $list[$i][wr_content])?></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr height="10">
											<td colspan="2"></td>
										</tr>
										<tr height="27px;">
							<?
								if($list[$i][wr_5] != "1"){
							?>
											<td><strong>연락처</strong> : <?=$list[$i][wr_3]?> </td>
							<?
								}
							?>
											<td align="right">
												<a href="javascript:;" onclick="sSNS('twitter', '', '<?=str_replace(array("\r\n","\r","\n"), "<br/>", $list[$i][wr_content])?>');"><img src="../img/home/btn_tweeter.gif" style="vertical-align:middle;" /></a>
												<a href="javascript:;" onclick="sSNS('me2day', '', '<?=str_replace(array("\r\n","\r","\n"), "<br/>", $list[$i][wr_content])?>');"><img src="../img/home/btn_me2day.gif" style="vertical-align:middle;" /></a>
												<a href="javascript:;" onclick="sSNS('facebook', '', '<?=str_replace(array("\r\n","\r","\n"), "<br/>", $list[$i][wr_content])?>');"><img src="../img/home/btn_facebook.gif" style="vertical-align:middle;" /></a>
												<a href="javascript:;" onclick="sSNS('cyworld', '', '<?=str_replace(array("\r\n","\r","\n"), "<br/>", $list[$i][wr_content])?>');"><img src="../img/home/btn_cyworld.gif" style="vertical-align:middle;" /></a>
											</td>
										</tr>
										<tr>
											<td colspan="2"><strong>이메일</strong> : <?=$list[$i][wr_4]?> </td>
										</tr>
										<tr>
											<td colspan="2">&nbsp;</td>
										</tr>
										<tr height="30px;">
											<td colspan="2"><strong>댓글(<span id="re_<?=$list[$i][wr_id]?>"><?=!$list[$i]['comment_cnt']?"0":$list[$i]['comment_cnt']?></span>)개</strong></td>
										</tr>
										<tr>
											<td colspan="2">
												<div id="table_<?=$list[$i][wr_id]?>">
												<table>
		<? if(!$list[$i]['result_arr']){ ?>
													<tr>
														<td>&nbsp;</td>
													</tr>
		<? } ?>			
		<? for ($j=0; $row=sql_fetch_array($list[$i]['result_arr']); $j++) {
			$name_sub_arr = get_sideview_sub($row['mb_id'], $row['wr_name'], $row['wr_email'], $row['wr_homepage']); 
		?>
													<tr>
														<td>
				<?
					if(intval($row['step']) > 1){
						//for($k=1; $k<intval($row['step']); $k++){
							echo "&nbsp;&nbsp;&nbsp;&nbsp;";
						//}
				?>
															<img src="../img/product/icon_re.gif" width="17" height="11" hspace="3" vspace="3" align="absmiddle" />
				<?
					}
				?>
															<?=$name_sub_arr?><img src="<?=$row['mb_icon']?>" width="22" height="23" align="absmiddle" />
															&nbsp;&nbsp;&nbsp;&nbsp;<?=$row['wr_content']?>
															<? if($member['mb_id']){?>
															&nbsp;&nbsp;<img src="../img/product/bt_re.gif" style="cursor:pointer;" onclick="javascript:showContent('<?=$list[$i][wr_id]?>_<?=$row['wr_id']?>');" width="40" height="19" vspace="2" align="absmiddle" />
															<?}?>
				<? if($member['mb_id'] == $row['mb_id'] || $is_admin == "super" || $is_auth){ ?>
															&nbsp;<img src="../img/product/bt_del.gif" style="cursor:pointer;" onclick="javascript:deleteContent('<?=$list[$i][wr_id]?>', '<?=$row['wr_id']?>', '<?=$row['step']?>', '<?=$row['family_cnt']?>');" width="40" height="19" vspace="2" align="absmiddle" />
				<? } ?>
														</td>
													</tr>
													<tr id="<?=$list[$i][wr_id]?>_<?=$row['wr_id']?>_content" style="display:none">
														<td>
															<input type="text" name="re_content_<?=$list[$i][wr_id]?>_<?=$row['wr_id']?>" id="re_content_<?=$list[$i][wr_id]?>_<?=$row['wr_id']?>" size="110" />
															<img src="../img/product/bt_enter.gif" style="cursor:pointer;" onclick="javascript:writeContent('<?=$list[$i][wr_id]?>', '<?=$row['wr_id']?>', '<?=$row['orderby']?>', '<?=$row['step']?>');" width="46" height="22" align="absmiddle" />
														</td>
													</tr>
		<? } ?>
												</table>
												</div>
											</td>
										</tr>
										<tr>
											<td colspan="2">&nbsp;</td>
										</tr>
		<? if ($member['mb_id']) { ?>
										<tr>
											<td colspan="2">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td><strong>댓글</strong></td>
														<td align="center"><input type="text" name="re_content_<?=$list[$i][wr_id]?>_0" id="re_content_<?=$list[$i][wr_id]?>_0" size="110" /></td>
														<td>
															<img src="../img/product/bt_enter.gif" style="cursor:pointer;" onclick="javascript:writeContent('<?=$list[$i][wr_id]?>', '0', '0', '0');" width="46" height="22" align="absmiddle" />
														</td>
													</tr>
												</table>
											</td>
										</tr>
		<? } ?>
									</table>
								</td>
							</tr>
							<tr class="list_<?=$list[$i][wr_id]?>">
							  	<td height="30" colspan="2" align="center">
							  		<p style="padding-bottom:5px;"><img id="spanDiv_<?=$i?>" style="cursor:pointer;" src="../img/product/btn_up.gif" style="vertical-align:middle;" onclick="javascript:showDetail(<?=$i?>)" /></p>
							  	</td>
							  </tr>
<?if (1==2){?>
							<tr class="bg<?=$bg?>"> 
								<td class="num">
            <? 
            if ($list[$i][is_notice]) // 공지사항 
                echo "<b>공지</b>";
            else if ($wr_id == $list[$i][wr_id]) // 현재위치
                echo "<span class='current'>{$list[$i][num]}</span>";
            else
                echo $list[$i][num];
            ?>
								</td>
        <? if ($is_checkbox) { ?>
        						<td class="checkbox"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td>
        <? } ?>
								<td class="subject">
		<? 
            echo $nobr_begin;
            echo $list[$i][reply];
            echo $list[$i][icon_reply];
            if ($is_category && $list[$i][ca_name]) { 
                echo "<span class=small><font color=gray>[<a href='{$list[$i][ca_name_href]}'>{$list[$i][ca_name]}</a>]</font></span> ";
            }

            /*if ($list[$i][is_notice])
                echo "<a href='{$list[$i][href]}'><span class='notice'>{$list[$i][subject]}</span></a>";
            else
                echo "<a href='{$list[$i][href]}'>{$list[$i][subject]}</a>";*/

            if ($list[$i][comment_cnt]) 
                echo " <a href=\"{$list[$i][comment_href]}\"><span class='comment'>{$list[$i][comment_cnt]}</span></a>";

            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

            
            //echo " " . $list[$i][icon_file];
            //echo " " . $list[$i][icon_link];
            //echo " " . $list[$i][icon_secret];
		?>
		<?
            echo "<a href='".str_replace("board.php","board_sellitem.php", $list[$i][href])."'><img src='".$list[$i][file][0][path]."/".$list[$i][file][0][file]."' align='absmiddle' border='0' width='100' height='100' class='bigImg'></a>";
            if ($list[$i][file][0]){
            	echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][0][path]."/".$list[$i][file][0][file]."');\"><img src='".$list[$i][file][0][path]."/".$list[$i][file][0][file]."' align='absmiddle' border='0' width='40' height='40'></a>";
            }
            	
            if ($list[$i][file][1])
            	echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][1][path]."/".$list[$i][file][1][file]."');\"><img src='".$list[$i][file][1][path]."/".$list[$i][file][1][file]."' align='absmiddle' border='0' width='40' height='40'></a>";
            
            if ($list[$i][file][2])
            	echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][2][path]."/".$list[$i][file][2][file]."');\"><img src='".$list[$i][file][2][path]."/".$list[$i][file][2][file]."' align='absmiddle' border='0' width='40' height='40'></a>";
            	
            if ($list[$i][file][3])
            	echo "<a href=\"javascript:imgChange(".$i.",'".$list[$i][file][3][path]."/".$list[$i][file][3][file]."');\"><img src='".$list[$i][file][3][path]."/".$list[$i][file][3][file]."' align='absmiddle' border='0' width='40' height='40'></a>";
            	
            echo " " . $list[$i][icon_new];
            echo " " . $list[$i][icon_hot];
            
            echo " <a href='".str_replace("board.php","board_sellitem.php", $list[$i][href])."'><b>" . $list[$i][itemBrand]."</b>";
            echo "&nbsp;<b>" . $list[$i][itemName]."</b>";
            echo "&nbsp;<b>" . han_price($list[$i][itemPrice])."</b></a>";
		?>
							<div class="divDetail" style="display:none">
								<div style="border:1 solid blue;">
            	<?=str_replace("\n","<br>", $list[$i][wr_content])?>
            					</div>
								<p>연락처: <?=$list[$i][wr_3]?></p>
								<p>이메일: <?=$list[$i][wr_4]?></p>
            	<?
				// 코멘트 입출력
				
				?>
									</div>
									</br><a href="javascript:showDetail(<?=$i?>)"><span class="spanDiv">더보기</span></a>
            <?
            echo $nobr_end;
            ?>
								</td>
								<td class="name"><?=$list[$i][name]?></td>
								<td class="datetime"><?=$list[$i][datetime2]?></td>
								<td class="hit"><?=$list[$i][wr_hit]?></td>
	<? if ($is_good) { ?>		<td class="good"><?=$list[$i][wr_good]?></td><? } ?>
	<? if ($is_nogood) { ?>		<td class="nogood"><?=$list[$i][wr_nogood]?></td><? } ?>
							</tr>
	<?}?>
<? } // end for ?>
    <? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>

						</table>
						<div style="padding:20px 0;text-align:center;">
							<!-- 배너 들어가는곳 -->
							<img src="/img/banner/banner.jpg" width="90%" height="100%"/>
						</div>
</div>
					    <table>
					    	<tr>
								<td>
									<a href="javascript:add_dis_table()">
										<img src="<?=$board_skin_path?>/img/btn_moreb.gif" align="absmiddle" border='0' alt="더보기">
									</a>
								</td>
							</tr>
					    </table>
</form>
<!--
						<div class="board_button">
							<div style="float:left;">

        <? if ($is_checkbox) { ?>
								<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align="absmiddle" border='0'></a>
								<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" align="absmiddle" border='0'></a>
								<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" align="absmiddle" border='0'></a>
        <? } ?>	
							</div>


						</div>
-->

    <!-- 페이지 -->
<!--
						<div class="board_page">
        <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/page_search_prev.gif' border='0' align=absmiddle title='이전검색'></a>"; } ?>
        <?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        //echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        //$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><span style=\"color:#4D6185; font-size:12px; text-decoration:underline;\">$1</span></b>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/page_search_next.gif' border='0' align=absmiddle title='다음검색'></a>"; } ?>
						</div>
-->

			<!-- 검색 -->
						<!-- div class="board_search">
<form name="fsearch" method="get">
						<input type="hidden" name="bo_table" value="<?=$bo_table?>">
						<input type="hidden" name="sca"      value="<?=$sca?>">
						<select name="sfl">
							<option value="wr_subject">제목</option>
							<option value="wr_content">내용</option>
							<option value="wr_subject||wr_content">제목+내용</option>
							<option value="mb_id,1">회원아이디</option>
							<option value="mb_id,0">회원아이디(코)</option>
							<option value="wr_name,1">글쓴이</option>
							<option value="wr_name,0">글쓴이(코)</option>
						</select>
						<input name="stx" class="stx" maxlength="15" itemname="검색어" required value='<?=stripslashes($stx)?>'>
						<input type="image" src="<?=$board_skin_path?>/img/btn_search.gif" border='0' align="absmiddle">
						<input type="radio" name="sop" value="and">and
						<input type="radio" name="sop" value="or">or
</form>
						</div-->
					</td>
				</tr>
			</table>
		</td>
		<td width="300" valign="top" >
<form name="sidoSearchFrm" method="post">
		<input type="hidden" name="sidoStr" id="sidoStr">
		<input type="hidden" name="bo_gubun" id="bo_gubun" value="my_sidoSearch">
		<input type="hidden" name="bo_table" id="bo_table" value="<?=$bo_table?>">
			<table>
				<tr>
					<td height="38"><img src="../img/product/stitle_zone.gif" width="31" height="17" /></td>
				</tr>
				<tr>
					<td height="30" class="txt14">전체</td>
				</tr>
				<tr>
					<td class="txt14">
  						<span style="cursor:pointer;" onclick="javascript:sidoChange('seoul','서울')">
							<img src="../img/product/icon_select<?=$seoul_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="seoul_img" /> 서울
						</span>
						<input type="hidden" name="seoul_view" id="seoul_view" value="<?=$seoul_view?$seoul_view:'0'?>">
					</td>
				</tr>
				<tr id="seoul">
    <? 
    $allChecked = "";
    $attrChecked = "";
    $tmpStr = array();
    $tmpStr = explode(",", $sidoStr);
    
    /*for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) { 
        if($i == 0){
        	if($seoul_all == "서울"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"seoul_all\" id=\"seoul_all\" value=\"서울\" ".$allChecked." onclick=\"javascript:allCheckYn('seoul');\" />서울 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
    	if($seoul_all == "서울"){
        	$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "서울|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"seoul_attr\" id=\"seoul_attr\" value=\"서울|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('seoul');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN']);
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($seoul_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    */
    ?>
	<td class="left22">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
 				<td class="txt12_g">
					<input type="checkbox" name="seoul_all" id="seoul_all" value="서울" <? if($seoul_all == "서울"){ echo "checked"; } ?>  onclick="javascript:allCheckYn('seoul');" />서울 전지역
				</td>
			</tr>
			<tr>
				<td height="15"><img src="../img/product/dot.gif" width="242" height="1" /></td>
			</tr>
		</table>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="3" class="txt12_g1">강남지역</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|강남"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|강남" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />강남
						<?
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "강남")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|관악"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|관악" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />관악
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "관악")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|강서"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|강서" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />강서
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "강서")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
					</tr>
					<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|서초"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|서초" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />서초
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "서초")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|동작"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|동작" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />동작
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "동작")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|양천"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|양천" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />양천
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "양천")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|송파"){
					$attrChecked = "checked";
				}
			}
		}
	?>					
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|송파" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />송파
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "송파")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|영등포"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|영등포" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />영등포
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "영등포")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|구로"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|구로" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />구로
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "구로")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|강동"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|강동" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />강동
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "강동")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|금천"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|금천" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />금천
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "금천")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td colspan="3" class="txt12_g1">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3" class="txt12_g1">강북지역</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|광진"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|광진" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />광진
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "광진")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|노원"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|노원" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />노원
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "노원")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|마포"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|마포" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />마포
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "마포")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|성동"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|성동" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />성동
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "성동")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|성북"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|성북" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />성북
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "성북")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|서대문"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|서대문" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />서대문
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "서대문")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|동대문"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|동대문" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />동대문
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "동대문")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|강북"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|강북" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />강북
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "강북")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|은평"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|은평" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />은평
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "은평")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|중랑"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|중랑" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />중랑
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "중랑")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|도봉"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|도봉" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />도봉
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "도봉")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|종로"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|종로" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />종로
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "종로")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|중구"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|중구" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />중구
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "중구")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td width="33%">
					<strong>
	<?
		$attrChecked = "";
		if($seoul_all == "서울"){
			$attrChecked = "checked";
		}else{
			for ($j=0; $j<sizeof($tmpStr); $j++) {
				if($tmpStr[$j] == "서울|용산"){
					$attrChecked = "checked";
				}
			}
		}
	?>
						<input type="checkbox" name="seoul_attr" id="seoul_attr" value="서울|용산" <?=$attrChecked?> onclick="javascript:attrCheckYn('seoul');" />용산
						<?
						@mysql_data_seek($seoul_arr,0);
						for ($i=0; $row=sql_fetch_array($seoul_arr); $i++) {
							if (strstr($row['GUGUN'], "용산")){
								echo "(".$row['totcnt'].")";
								break;
							}
						}?>
					</strong>
				</td>
				<td></td>
			</tr>
			<tr>
				<td colspan="3">&nbsp;</td>
			</tr>
		</table>
		</td>    
      </tr>
				<tr>
        			<td class="txt14">
        				<span style="cursor:pointer;" onclick="javascript:sidoChange('gyounggi','경기')">
        					<img src="../img/product/icon_select<?=$gyounggi_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="gyounggi_img" /> 경기
        				</span>
        				<input type="hidden" name="gyounggi_view" id="gyounggi_view" value="<?=$gyounggi_view?$gyounggi_view:'0'?>">
        			</td>
      			</tr>
				<tr id="gyounggi">
    <? 
    $attrChecked = "";
    for ($i=0; $row=sql_fetch_array($gyounggi_arr); $i++) { 
        if($i == 0){
        	if($gyounggi_all == "경기"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"gyounggi_all\" id=\"gyounggi_all\" value=\"경기\" ".$allChecked." onclick=\"javascript:allCheckYn('gyounggi');\" />경기 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($gyounggi_all == "경기"){
        	$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "경기|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"gyounggi_attr\" id=\"gyounggi_attr\" value=\"경기|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('gyounggi');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($gyounggi_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('inchoen','인천')">
							<img src="../img/product/icon_select<?=$inchoen_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="inchoen_img" /> 인천
						</span>
						<input type="hidden" name="inchoen_view" id="inchoen_view" value="<?=$inchoen_view?$inchoen_view:'0'?>">
					</td>
				</tr>
				<tr id="inchoen">
      <? 
    for ($i=0; $row=sql_fetch_array($inchoen_arr); $i++) { 
        if($i == 0){
        	if($inchoen_all == "인천"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"inchoen_all\" id=\"inchoen_all\" value=\"인천\" ".$allChecked." onclick=\"javascript:allCheckYn('inchoen');\" />인천 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($inchoen_all == "인천"){
        	$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "인천|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"inchoen_attr\" id=\"inchoen_attr\" value=\"인천|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('inchoen');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($inchoen_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('busan','부산')">
							<img src="../img/product/icon_select<?=$busan_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="busan_img" /> 부산
						</span>
						<input type="hidden" name="busan_view" id="busan_view" value="<?=$busan_view?$busan_view:'0'?>">
					</td>
  				</tr>
				<tr id="busan">
      <? 
    for ($i=0; $row=sql_fetch_array($busan_arr); $i++) { 
        if($i == 0){
        	if($busan_all == "부산"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"busan_all\" id=\"busan_all\" value=\"부산\" ".$allChecked." onclick=\"javascript:allCheckYn('busan');\" />부산 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($busan_all == "부산"){
        	$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "부산|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"busan_attr\" id=\"busan_attr\" value=\"부산|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('busan');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($busan_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
 					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('deagu','대구')">
							<img src="../img/product/icon_select<?=$deagu_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="deagu_img" /> 대구
						</span>
						<input type="hidden" name="deagu_view" id="deagu_view" value="<?=$deagu_view?$deagu_view:'0'?>">
					</td>
      			</tr>
				<tr id="deagu">
      <? 
    for ($i=0; $row=sql_fetch_array($deagu_arr); $i++) { 
        if($i == 0){
        	if($deagu_all == "대구"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"deagu_all\" id=\"deagu_all\" value=\"대구\" ".$allChecked." onclick=\"javascript:allCheckYn('deagu');\" />대구 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($deagu_all == "대구"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "대구|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"deagu_attr\" id=\"deagu_attr\" value=\"대구|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('deagu');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($deagu_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
					<span style="cursor:pointer;" onclick="javascript:sidoChange('deajeon','대전')">
						<img src="../img/product/icon_select<?=$deajeon_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="deajeon_img" /> 대전
					</span>
					<input type="hidden" name="deajeon_view" id="deajeon_view" value="<?=$deajeon_view?$deajeon_view:'0'?>">
					</td>
				</tr>
				<tr id="deajeon">
      <? 
    for ($i=0; $row=sql_fetch_array($deajeon_arr); $i++) { 
        if($i == 0){
        	if($deajeon_all == "대전"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"deajeon_all\" id=\"deajeon_all\" value=\"대전\" ".$allChecked." onclick=\"javascript:allCheckYn('deajeon');\" />대전 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($deajeon_all == "대전"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "대전|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"deajeon_attr\" id=\"deajeon_attr\" value=\"대전|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('deajeon');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($deajeon_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
  					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('kwanggu','광주')">
							<img src="../img/product/icon_select<?=$kwanggu_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="kwanggu_img" /> 광주
						</span>
						<input type="hidden" name="kwanggu_view" id="kwanggu_view" value="<?=$kwanggu_view?$kwanggu_view:'0'?>">
					</td>
				</tr>
				<tr id="kwanggu">
      <? 
    for ($i=0; $row=sql_fetch_array($kwanggu_arr); $i++) { 
        if($i == 0){
        	if($kwanggu_all == "광주"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"kwanggu_all\" id=\"kwanggu_all\" value=\"광주\" ".$allChecked." onclick=\"javascript:allCheckYn('kwanggu');\" />광주 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($kwanggu_all == "광주"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "광주|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"kwanggu_attr\" id=\"kwanggu_attr\" value=\"광주|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('kwanggu');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($kwanggu_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('ulsan','울산')">
       						<img src="../img/product/icon_select<?=$ulsan_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="ulsan_img" /> 울산
						</span>
						<input type="hidden" name="ulsan_view" id="ulsan_view" value="<?=$ulsan_view?$ulsan_view:'0'?>">
					</td>
				</tr>
				<tr id="ulsan">
      <? 
    for ($i=0; $row=sql_fetch_array($ulsan_arr); $i++) { 
        if($i == 0){
        	if($ulsan_all == "울산"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"ulsan_all\" id=\"ulsan_all\" value=\"울산\" ".$allChecked." onclick=\"javascript:allCheckYn('ulsan');\" />울산 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($ulsan_all == "울산"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "울산|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"ulsan_attr\" id=\"ulsan_attr\" value=\"울산|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('ulsan');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($ulsan_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('kangwon','강원')">
       						<img src="../img/product/icon_select<?=$kangwon_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="kangwon_img" /> 강원
						</span>
						<input type="hidden" name="kangwon_view" id="kangwon_view" value="<?=$kangwon_view?$kangwon_view:'0'?>">
					</td>
				</tr>
				<tr id="kangwon">
      <? 
    for ($i=0; $row=sql_fetch_array($kangwon_arr); $i++) { 
        if($i == 0){
        	if($kangwon_all == "강원"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"kangwon_all\" id=\"kangwon_all\" value=\"강원\" ".$allChecked." onclick=\"javascript:allCheckYn('kangwon');\" />강원 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($kangwon_all == "강원"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "강원|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"kangwon_attr\" id=\"kangwon_attr\" value=\"강원|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('kangwon');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($kangwon_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
 				<tr>
 					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('chungbuk','충북')">
							<img src="../img/product/icon_select<?=$chungbuk_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="chungbuk_img" /> 충북
						</span>
						<input type="hidden" name="chungbuk_view" id="chungbuk_view" value="<?=$chungbuk_view?$chungbuk_view:'0'?>">
					</td>
				</tr>
				<tr id="chungbuk">
      <? 
    for ($i=0; $row=sql_fetch_array($chungbuk_arr); $i++) { 
        if($i == 0){
     		if($chungbuk_all == "충북"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"chungbuk_all\" id=\"chungbuk_all\" value=\"충북\" ".$allChecked." onclick=\"javascript:allCheckYn('chungbuk');\" />충북 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($chungbuk_all == "충북"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "충북|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"chungbuk_attr\" id=\"chungbuk_attr\" value=\"충북|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('chungbuk');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($chungbuk_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('chungnam','충남')">
 							<img src="../img/product/icon_select<?=$chungnam_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="chungnam_img" /> 충남
						</span>
						<input type="hidden" name="chungnam_view" id="chungnam_view" value="<?=$chungnam_view?$chungnam_view:'0'?>">
					</td>
				</tr>
				<tr id="chungnam">
      <? 
    for ($i=0; $row=sql_fetch_array($chungnam_arr); $i++) { 
        if($i == 0){
        	if($chungnam_all == "충남"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"chungnam_all\" id=\"chungnam_all\" value=\"충남\" ".$allChecked." onclick=\"javascript:allCheckYn('chungnam');\" />충남 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($chungnam_all == "충남"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "충남|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"chungnam_attr\" id=\"chungnam_attr\" value=\"충남|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('chungnam');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($chungnam_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
 					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('kyoungbuk','경북')">
							<img src="../img/product/icon_select<?=$kyoungbuk_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="kyoungbuk_img" /> 경북
						</span>
						<input type="hidden" name="kyoungbuk_view" id="kyoungbuk_view" value="<?=$kyoungbuk_view?$kyoungbuk_view:'0'?>">
					</td>
				</tr>
				<tr id="kyoungbuk">
      <? 
    for ($i=0; $row=sql_fetch_array($kyoungbuk_arr); $i++) { 
        if($i == 0){
        	if($kyoungbuk_all == "경북"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"kyoungbuk_all\" id=\"kyoungbuk_all\" value=\"경북\" ".$allChecked." onclick=\"javascript:allCheckYn('kyoungbuk');\" />경북 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($kyoungbuk_all == "경북"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "경북|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"kyoungbuk_attr\" id=\"kyoungbuk_attr\" value=\"경북|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('kyoungbuk');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($kyoungbuk_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('kyoungnam','경남')">
							<img src="../img/product/icon_select<?=$kyoungnam_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="kyoungnam_img" /> 경남
						</span>
						<input type="hidden" name="kyoungnam_view" id="kyoungnam_view" value="<?=$kyoungnam_view?$kyoungnam_view:'0'?>">
					</td>
				</tr>
				<tr id="kyoungnam">
      <? 
    for ($i=0; $row=sql_fetch_array($kyoungnam_arr); $i++) { 
        if($i == 0){
        	if($kyoungnam_all == "경남"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"kyoungnam_all\" id=\"kyoungnam_all\" value=\"경남\" ".$allChecked." onclick=\"javascript:allCheckYn('kyoungnam');\" />경남 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($kyoungnam_all == "경남"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "경남|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"kyoungnam_attr\" id=\"kyoungnam_attr\" value=\"경남|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('kyoungnam');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($kyoungnam_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
					<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('jeonbuk','전북')">
							<img src="../img/product/icon_select<?=$jeonbuk_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="jeonbuk_img" /> 전북
						</span>
						<input type="hidden" name="jeonbuk_view" id="jeonbuk_view" value="<?=$jeonbuk_view?$jeonbuk_view:'0'?>">
					</td>
				</tr>
				<tr id="jeonbuk">
      <? 
    for ($i=0; $row=sql_fetch_array($jeonbuk_arr); $i++) { 
        if($i == 0){
        	if($jeonbuk_all == "전북"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"jeonbuk_all\" id=\"jeonbuk_all\" value=\"전북\" ".$allChecked." onclick=\"javascript:allCheckYn('jeonbuk');\" />전북 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($jeonbuk_all == "전북"){
        	$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "전북|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"jeonbuk_attr\" id=\"jeonbuk_attr\" value=\"전북|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('jeonbuk');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($jeonbuk_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
       				<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('jeonnam','전남')">
							<img src="../img/product/icon_select<?=$jeonnam_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="jeonnam_img" /> 전남
						</span>
						<input type="hidden" name="jeonnam_view" id="jeonnam_view" value="<?=$jeonnam_view?$jeonnam_view:'0'?>">
					</td>
				</tr>
				<tr id="jeonnam">
      <? 
    for ($i=0; $row=sql_fetch_array($jeonnam_arr); $i++) { 
        if($i == 0){
        	if($jeonnam_all == "전남"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"jeonnam_all\" id=\"jeonnam_all\" value=\"전남\" ".$allChecked." onclick=\"javascript:allCheckYn('jeonnam');\" />전남 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($jeonnam_all == "전남"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "전남|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"jeonnam_attr\" id=\"jeonnam_attr\" value=\"전남|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('jeonnam');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($jeonnam_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
				<tr>
       				<td class="txt14">
						<span style="cursor:pointer;" onclick="javascript:sidoChange('jeju','제주')">
 							<img src="../img/product/icon_select<?=$jeju_view=="1"?'01':'02'?>.gif" width="19" height="19" align="absmiddle" id="jeju_img" /> 제주
						</span>
						<input type="hidden" name="jeju_view" id="jeju_view" value="<?=$jeju_view?$jeju_view:'0'?>">
					</td>
				</tr>
				<tr id="jeju">
      <? 
    for ($i=0; $row=sql_fetch_array($jeju_arr); $i++) { 
        if($i == 0){
        	if($jeju_all == "제주"){
        		$allChecked = "checked";
        	}
        	echo "\n	<td class=\"left22\">";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
			echo "\n			<tr>";
			echo "\n 				<td class=\"txt12_g\">";
			echo "\n					<input type=\"checkbox\" name=\"jeju_all\" id=\"jeju_all\" value=\"제주\" ".$allChecked." onclick=\"javascript:allCheckYn('jeju');\" />제주 전지역";
			echo "\n				</td>";
			echo "\n			</tr>";
			echo "\n			<tr>";
			echo "\n				<td height=\"15\"><img src=\"../img/product/dot.gif\" width=\"242\" height=\"1\" /></td>";
			echo "\n			</tr>";
			echo "\n		</table>";
			echo "\n		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        }
		if($i == 0 || $i % 3 == 0){
			echo "\n		<tr>";
		}
		
		if($jeju_all == "제주"){
			$attrChecked = "checked";
        }else{
        	for ($j=0; $j<sizeof($tmpStr); $j++) {
        		if($tmpStr[$j] == "제주|".$row['GUGUN']){
        			$attrChecked = "checked";
        		}
        	}
        }
    	
		echo "\n	<td width=\"33%\">";
		echo "\n		<strong>";
		echo "\n			<input type=\"checkbox\" name=\"jeju_attr\" id=\"jeju_attr\" value=\"제주|".$row['GUGUN']."\" ".$attrChecked." onclick=\"javascript:attrCheckYn('jeju');\" />".str_replace(" ", "<br>&nbsp;&nbsp;&nbsp;&nbsp;", $row['GUGUN'])."({$row['totcnt']})";
		echo "\n		</strong>";
		echo "\n	</td>";
		
		if($i % 3 == 2){
			echo "\n		</tr>";
		}
		
		if($i == mysql_num_rows($jeju_arr)-1){
			if($i % 3 == 1){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}else if($i % 3 == 0){
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
				echo "\n		<td width=\"33%\">&nbsp;";
				echo "\n		</td>";
			}
			echo "\n		</tr>";
			echo "\n		<tr>";
			echo "\n			<td colspan=\"3\">&nbsp;</td>";
			echo "\n		</tr>";
			echo "\n	</table>";
			echo "\n	</td>";
		}
		$attrChecked = "";
    }
    $allChecked = "";
    ?>
				</tr>
			</table>
			<table>
				<tr>
  					<td>
						<!-- <a href="javascript:sidoSearch();">검색</a> -->
					</td>
				</tr>
			</table>
</form>
<form name="ajaxFrm" method="post">
	<input type="hidden" name="page" value="<?=count($list)<=12?1:$page?>">
</form>
		</td>
	</tr>
</table>
</body>
</html>

<script type="text/javascript">


function goScrap(wrId){
	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/scrap_ajax.php",
		  data: {
			  "mb_id": "<?=$member[mb_id]?>",
			  "bo_table": "<?=$bo_table?>",
			  "wr_id" : wrId
		  },
		  success: function(html){
			  if(html == "0"){
				alert("해당 상품을 관심상품에 추가하였습니다");
				$("#viewInter").text(eval($("#viewInter").text())+1);
				$("#scripView_"+wrId).html("<img src=\"../img/product/bt_minus.gif\" width=\"93\" height=\"22\" style=\"cursor:pointer;\" onclick=\"javascript:goScrapDel("+wrId+");\" />");
			  }else{
			    alert("이미 관심상품에 등록된 상품입니다.");
			  }
		  }
	});
}

function goScrapDel(wrId){
	if(!confirm("해당 상품을 관심상품에서 삭제하시겠습니까?")){
		return;
	}else{
		$.ajax({
			  type: "POST",
			  url: "<?=$board_skin_path?>/del_scrap_ajax.php",
			  data: {
				  "mb_id": "<?=$member[mb_id]?>",
				  "bo_table": "<?=$bo_table?>",
				  "wr_id" : wrId
			  },
			  success: function(html){
				  $("#viewInter").text(eval($("#viewInter").text())-1);
				  $("#scripView_"+wrId).html("<img src=\"../img/product/bt_plus.gif\" width=\"93\" height=\"22\" style=\"cursor:pointer;\" onclick=\"javascript:goScrap("+wrId+");\" />");
			  }
		});
	}
}

function goModify(wr_id){
	location.href = "/bbs/write_sellitem.php?bo_table=buyitem&chkItem=buy&w=u&wr_id="+wr_id;
	return;
}

function goDelete(wr_id){
	if(!confirm("정말 글을 삭제하시겠습니까?")){
		return;
	}else{
		$.ajax({
			  type: "POST",
			  url: "<?=$board_skin_path?>/list_del_ajax.php",
			  data: {
				  "bo_table": "<?=$g4['write_prefix'].$bo_table?>",
				  "wr_id": wr_id,
			  },
			  success: function(html){
				$(".list_"+wr_id).remove();
			  }
			});
	}
}

function showDetail(detailNo){
	if ($("#spanDiv_"+detailNo).attr("src") == "../img/product/btn_up.gif"){
		$("#spanDiv_"+detailNo).attr("src", "../img/product/btn_down.gif");
		//$(".divDetail").eq(detailNo).show("fast");
		$(".divDetail").eq(detailNo).show();
	}else{
		$("#spanDiv_"+detailNo).attr("src", "../img/product/btn_up.gif");
		//$(".divDetail").eq(detailNo).hide("fast");
		$(".divDetail").eq(detailNo).hide();
	}
}

function showContent(wr_id){
	if($("#"+wr_id+"_content").attr("style") == "DISPLAY: none"){
		$("#"+wr_id+"_content").attr("style", "DISPLAY: ''")
	}else{
		$("#"+wr_id+"_content").attr("style", "DISPLAY: none")
	}
}

function writeContent(wr_id, family, orderby, step){
	if($("#re_content_"+wr_id+"_"+family).val() == ""){
		alert("댓글 내용을 입력하세요");
		return;
	}else{
		$.ajax({
			  type: "POST",
			  url: "<?=$board_skin_path?>/content_ajax.php",
			  data: {
				  "re_content": encodeURIComponent($("#re_content_"+wr_id+"_"+family).val()),
				  "bo_table": "<?=$g4['write_prefix'].$bo_table?>",
				  "wr_id": wr_id,
				  "family": family,
				  "mb_id": "<?=$member['mb_id']?>",
				  "orderby": orderby,
				  "step": eval(step)+1,
				  "is_admin": "<?=$is_admin?>",
				  "is_auth": "<?=$is_auth?>"
			  },
			  success: function(html){
				if(html == "0"){
					alert("글이 존재하지 않습니다.\n글이 삭제되었거나 이동하였을 수 있습니다.");
				}else{
					var objTbl = $("#table_"+wr_id)[0];
					$(objTbl).html("");
					$(objTbl).html(html);
					$("#re_"+wr_id).text(eval($("#re_"+wr_id).text())+1);
					$("#re_content_"+wr_id+"_"+family).val("");
				}
			  }
			});
	}
}

function deleteContent(parent_wr_id, wr_id, step, family_cnt){
	if(step != "1" || family_cnt == "0"){
		if(!confirm("정말 댓글을 삭제하시겠습니까?")){
			return;
		}else{
			$.ajax({
				  type: "POST",
				  url: "<?=$board_skin_path?>/content_del_ajax.php",
				  data: {
					  "bo_table": "<?=$g4['write_prefix'].$bo_table?>",
					  "parent_wr_id": parent_wr_id,
					  "wr_id": wr_id,
					  "mb_id": "<?=$member['mb_id']?>"
				  },
				  success: function(html){
					  var objTbl = $("#table_"+parent_wr_id)[0];
						$(objTbl).html("");
						$(objTbl).html(html);
						$("#re_"+parent_wr_id).text(eval($("#re_"+parent_wr_id).text())-1);
				  }
				});
		}
	}else{
		alert("삭제하려는 글에 댓글이 존재하여 삭제할 수 없습니다.");
		return;
	}
}

function sidoChange(eng, kor){
	if($("#"+eng+"_view").val() == "1"){
		$("#"+eng).html("");
		$("#"+eng+"_img").attr("src", "../img/product/icon_select02.gif")
		$("#"+eng+"_view").val("0");
	}else{
		$.ajax({
			  type: "POST",
			  url: "<?=$board_skin_path?>/area_ajax.php",
			  data: {
				  "SIDO": encodeURIComponent(kor),
				  "SIDO_ENG": eng,
				  "table_name": "<?=$g4['write_prefix'].$bo_table?>"
			  },
			  success: function(html){
			    $("#"+eng).html(html);
			  }
			});
		$("#"+eng+"_img").attr("src", "../img/product/icon_select01.gif")
		$("#"+eng+"_view").val("1");
	}
}

function allCheckYn(eng){
	var c = $("#"+eng+"_all").attr("checked");
	$("input[name="+eng+"_attr]").attr("checked",c);
	sidoSearch();
}

function attrCheckYn(eng){
	var c = true;
	$("input[name="+eng+"_attr]").each(
		function(){
			if(!this.checked){
				c = false;
			}
		}
	)
	if(!c){
		$("#"+eng+"_all").attr("checked", c);
	}
	sidoSearch();
}

function sidoSearch(){
	var f = document.sidoSearchFrm;
	$("#sidoStr").val("");

	var x = ["seoul", "gyounggi", "inchoen", "busan", "deagu", "deajeon", "kwanggu", "ulsan",
	         "kangwon", "chungbuk", "chungnam", "kyoungbuk", "kyoungnam", "jeonbuk", "jeonnam", "jeju"];

	jQuery.each(x, function(index, value){
		if($("#"+value+"_all").attr("checked")){
			$("#sidoStr").val($("#sidoStr").val()+$("#"+value+"_all").val()+",");
		}else{
			$("input[name="+value+"_attr]").each(
				function(){
					if(this.checked){
						$("#sidoStr").val($("#sidoStr").val()+this.value+",");
					}
				}
			)
		}
	});

	$("#sidoStr").val($("#sidoStr").val().substring(0, $("#sidoStr").val().length -1));
    f.action = "<?=$g4['bbs_path']?>/board_buyitem.php";
    f.submit();
}

function add_dis_table(){

	$.ajax({
		  type: "POST",
		  url: "<?=$board_skin_path?>/list_view_ajax.php",
		  data: {
			  "page": eval(document.ajaxFrm.page.value)+1,
			  "bo_gubun": "<?=$bo_gubun?>",
			  "sop": "<?=$sop?>",
			  "sca": "<?=$sca?>",
			  "sfl": "<?=$sfl?>",
			  "stx": encodeURIComponent('<?=$stx?>'),
			  "write_table": "<?=$g4['write_prefix'].$bo_table?>",
			  "bo_table": "<?=$bo_table?>",
			  "mb_id": "<?=$member['mb_id']?>",
			  "param_data": encodeURIComponent('<?=$param_data?>'),
			  "sidoStr": encodeURIComponent('<?=$sidoStr?>'),
			  "page_row": "12",
			  "is_admin":"<?=$is_admin?>",
			  "is_auth": "<?=$is_auth?>"
		  },
		  success: function(html){
			  if(html == "0"){
				  alert("더이상 데이터가 없습니다.");
				  return;
			  }else{
				  var objTbl = $("#dis_table")[0];
				  objTbl.insertAdjacentHTML("afterEnd", html);
				  document.ajaxFrm.page.value = eval(document.ajaxFrm.page.value)+1;
			  }
			  $(".bigImg").bind('click',function(){
					if ($(this).attr("src") != "/img/noImage183x136.gif"){
						$("#layerImg0").attr("src",$(this).attr("src"));
						var newImg = new Image();
						newImg.src = $(this).attr("src");
						if ((newImg.width*411/newImg.height) > 711){
							$("#layerImg0").attr("width",'711');
						}else{
							$("#layerImg0").attr("width",newImg.width*411/newImg.height);
						}
						//$("#layerImg0").attr("height",newImg.height);
						$("#layerImg1").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('0').attr("src"));
						$("#layerImg2").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('1').attr("src"));
						$("#layerImg3").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('2').attr("src"));
						$("#layerImg4").attr("src",$(this).parent().parent().parent().parent().parent().parent().parent().next().find('img').eq('3').attr("src"));
						yPosition = $(document).scrollTop()-420;   
					    $("#bigImage").animate({"top":yPosition }, {duration:'fast', easing:'swing', queue:false});
						$("#bigImage").show();
						$("body").css("oracity","0.2");
						$("body").css("filter","alpha(opacity=20)");
						document.body.scroll = "no";
					    document.body.style.overflow = 'hidden';
					}
				});

				$(".classImg").bind('click',function(){
					$("#layerImg0").attr("src",$(this).attr("src"));
					var newImg = new Image();
					newImg.src = $(this).attr("src");
					if ((newImg.width*411/newImg.height) > 711){
						$("#layerImg0").attr("width",'711');
					}else{
						$("#layerImg0").attr("width",newImg.width*411/newImg.height);
					}
				});

				$(".imgClass").bind('click',function(event){ 
					event.stopPropagation();
				});
		  }
		});
}
</script>

<? if ($is_checkbox) { ?>
<script type="text/javascript">
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str) {
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete() {
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                       
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>
<script type="text/javascript" src="<?=$g4['path']?>/js/suggest.js"></script>
<script language="JavaScript">
    document.fsearchbox.stx.obj = 
        sug_set_properties(document.fsearchbox.stx, '<?=$board_skin_path?>/suggest_search_list_buyitem.php', true, true, true);
</script>
<!-- 게시판 목록 끝 -->
     